import axios from '@/utils/axios';

export interface DashboardMetrics {
    pendingPosts: number;      // 待审帖子数量
    pendingComments: number;   // 待审评论数量（新增）
    newUsers: number;          // 新用户数量
    newPostChange: number;        // 帖子数量变化
    newCommentChange: number;     // 评论数量变化
    newUserChange: number;        // 用户数量变化
    newPosts: number;          // 新帖子数量
    newComments: number;       // 新评论数量
    totalComments: number;     // 总评论数
    totalGames: number;        // 游戏总数
    totalPosts: number;        // 帖子总数
    totalUsers: number;        // 用户总数
    totalTagsPreference: number;  // 偏好标签总数
    totalTagsTopic: number;    // 话题标签总数
}

export const getDashboardMetrics = async (): Promise<DashboardMetrics> => {
    const response = await axios.get('/admin/dashboard/metrics');
    return response.data;
};

export const getPendingTasks = async () => {
    const response = await axios.get('/admin/dashboard/pending-tasks');
    return response.data;
};

export const getAuditTrends = async (days: number) => {
    const response = await axios.get(`/admin/dashboard/audit-trends?days=${days}`);
    return response.data;
};
